<template>
<Card>
  <p slot="title"><Icon type="md-search"></Icon>筛选搜索</p>
  <div slot="extra">
    <Button shape="circle" type="primary" icon="md-search" @click="onSearch">{{$t('search')}}</Button>
    <Button shape="circle" icon="md-sync" @click="onReset">{{$t('reset')}}</Button>
  </div>
  <Form ref="searchForm" :model="form" label-position="right" :label-width="100">
    <Row type="flex">
      <Col>
      <FormItem label="核销码" prop="code">
        <Input v-model="form.code" placeholder=""></Input>
      </FormItem>
      </Col>
      <Col>
      <FormItem label="用户姓名" prop="realName">
        <Input v-model="form.realName" placeholder=""></Input>
      </FormItem>
      </Col>
      <Col>
      <FormItem label="用户手机号" prop="mobilePhone">
        <Input v-model="form.mobilePhone" placeholder=""></Input>
      </FormItem>
      </Col>
      <Col>
      <FormItem label="用户身份证号" prop="idCard">
        <Input v-model="form.idCard" placeholder=""></Input>
      </FormItem>
      </Col>
      <Col>
      <FormItem label="状态" prop="status">
        <Select v-model="form.status">
            <Option :value="99">全部</Option>
            <Option :value="10">初建</Option>
            <Option :value="15">已过期</Option>
            <Option :value="20">已核销</Option>
            <Option :value="25">已废弃</Option>
        </Select>
      </FormItem>
      </Col>
    </Row>
  </Form>
</Card>
</template>
<script>
export default {
  props: {
    params: {
      type: Object,
      default () {
        return {}
      }
    }
  },
  data () {
    return {
      form: {
        code: '',
        realName: '',
        mobilePhone: '',
        idCard: '',
        status: 99
      }
    }
  },
  mounted () {
    // this.form = this.model
  },
  methods: {
    onSearch () {
      this.$emit('on-search', this.form)
    },
    onReset () {
      this.$refs['searchForm'].resetFields()
    }
  }
}
</script>
